function Util() {
	this.white_domain = ['event.m.shihou.tv', 'resource.youxiduo.com']; //生产环境白名单
	this.init();
}
Util.prototype = {
	init: function() {
		//根据host判断当前是测试环境还是正式环境
		if(this.checkDomain()) {
			this.realBaseUrl();
		} else {
			this.testBaseUrl();
		}
	},
	testBaseUrl: function() {
		console.log('测试环境');
		this.baseUrl = 'http://112.124.121.34:8201/lion_module_share_temp';
		this.baseUrlWage = 'http://112.124.121.34:7069/shihou.extra.wage.mainstage';
	},
	realBaseUrl: function() {
		console.log('生产环境');
		this.baseUrl = 'http://event.m.shihou.tv/lion_module_share_temp';
		this.baseUrlWage = 'http://api.shihou.youxiduo.com/shihou.extra.wage.mainstage';
	},
	//验证domain
	checkDomain: function() {
		var domain = document.domain;
		for(var i = 0; i < this.white_domain.length; i++) {
			var domai = this.white_domain[i];
			if(domain == domai)
				return true;
		}
		return false;
	},
	//获取当天日期
	getNowFormatDate: function(year, month, day) {
		year = year || 0;
		month = month || 0;
		day = day || 0;
		var date = new Date();
		date.setFullYear(date.getFullYear() + year);
		date.setMonth(date.getMonth() + month);
		date.setDate(date.getDate()+day);//获取day天后的日期 
		var seperator1 = "-";
		var seperator2 = ":";
		var month = date.getMonth() + 1;
		var strDate = date.getDate();
		if(month >= 1 && month <= 9) {
			month = "0" + month;
		}
		if(strDate >= 0 && strDate <= 9) {
			strDate = "0" + strDate;
		}
		var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate ;//+ " " + date.getHours() + seperator2 + date.getMinutes();
		return currentdate;
	},
	//获取url中的参数
	getUrlParam: function(name, url) {
		var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
		url = url || window.location.search.substr(1).match(reg); //匹配目标参数
		if(url != null) return unescape(url[2]);
		return null; //返回参数值
	},
	getUrlParams: function() {
		var url = window.location.href; //匹配目标参数
		if(url != null)
			return url.substr(url.indexOf("?"), url.length);
	},
	parseResult: function() { //解析结果， 如果不存在则返回''
		var size = arguments.length;
		if(size == 0) {
			return '';
		}
		var result = arguments[0];
		for(var i = 1; i < size; i++) {
			if(result == undefined) {
				return '';
			}
			var argu = arguments[i];
			if(i == size) {
				return argu;
			}
			result = result[argu];
		}
		return result;
	},
	requestRemoteDataJson: function(url, data, callback, asyn) {
		this.logURL(url);
		//this.logParameter(data);
		var begin = (new Date()).getTime();
		$.ajax({
			url: url,
			type: 'GET',
			async: asyn,
			cache: false,
			dataType: "json",
			data: data,
			success: callback,
			error: function(data) {
				var status = data.status;
				console.log(url + "获取数据失败!");
			}
		});
	},
	log: function(data) {
		console.log(data);
	},
	logURL: function(url) {
		console.log("url --> " + url);
	},
	logParameter: function(data) {
		console.log("parameter --> " + JSON.stringify(data));
	},
	logResult: function(result) {
		console.log("result --> " + JSON.stringify(result));
	},
	logResult: function(url, result) {
		console.log(url + " --> " + JSON.stringify(result));
	}
}